import { createSlice, PayloadAction } from "@reduxjs/toolkit";



interface UserTranslationState {
    isTraslation: boolean;
    translationDate: string | null;
}

const initialState: UserTranslationState = {
    isTraslation: false,
    translationDate: null,
}


const userTranslationSlice = createSlice({
    name: "userTranslation",
    initialState,
    reducers: {
        updateTrastionion: (state, action: PayloadAction<{ isTraslation: boolean, translationDate: string | null }>) => {
            state.isTraslation = action.payload.isTraslation;
            state.translationDate = action.payload.translationDate;
        }
    }
})

export const { updateTrastionion } = userTranslationSlice.actions;
export default userTranslationSlice.reducer;
